FROM golang:1.13-alpine3.11 AS builder
RUN apk --no-cache add make bash git perl gcc musl-dev
WORKDIR /opt/
COPY . .
RUN env GOFLAGS="-mod=vendor" make bin

FROM alpine:3.11
RUN apk --no-cache add ca-certificates su-exec
WORKDIR /opt/
COPY --from=builder /opt/dist/kyc_admin_service.bin .
RUN touch kyc_admin.toml

CMD ["su-exec", "nobody:nobody", "/opt/kyc_admin_service.bin"]
